﻿using System.Windows.Forms;

namespace Beehive_Management_System
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            var workers = new Worker[4];

            workers[0] = new Worker(new[] {"Nectar collector", "Honey Manufacturing"}, 175);
            workers[1] = new Worker(new[] {"Egg care", "Baby bee tutoring"}, 114);
            workers[2] = new Worker(new[] {"Hive maintenance", "Sting Patrol"}, 149);
            workers[3] = new Worker(new[] { "Nectar collector", "Honey Manufacturing",
                                                "Egg care", "Baby bee tutoring", "Hive maintenance", "Sting Patrol"}, 155);

            queen = new Queen(workers);
        }

        Queen queen;

        private void button2_Click(object sender, System.EventArgs e)
        {
            if (queen.AssignWork(workerBeeJob.Text, (int)shifts.Value) == false)
            {
                MessageBox.Show("Для этого задания рабочих нет '" + workerBeeJob.Text + "'", "Матка говорит...");
            }
            else
            {
                MessageBox.Show("Задание '" + workerBeeJob.Text + "' будет закончено через " + shifts.Value + " смен",
                                "Матка говорит...");
            }
        }

        private void workButton_Click(object sender, System.EventArgs e)
        {
            reportTextBox.Text = queen.WorkTheNextShifts();
        }
    }
}
